
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
      <meta charset="UTF-8"/>
      <title>SpotBugs Report</title>
      <style type="text/css">
		.tablerow0 {
			background: #EEEEEE;
		}

		.tablerow1 {
			background: white;
		}

		.detailrow0 {
			background: #EEEEEE;
		}

		.detailrow1 {
			background: white;
		}

		.tableheader {
			background: #b9b9fe;
			font-size: larger;
		}
		</style>
   </head>
   <body>
      <h1>SpotBugs Report</h1>
      <p>Produced using <a href="https://spotbugs.github.io">SpotBugs</a>4.4.2.</p>
      <p>Project: 
			jpacman[jpacman.main]</p>
      <h2>Metrics</h2>
      <p>1474 lines of code analyzed,
	in 53 classes, 
	in 9 packages.</p>
      <table width="500" cellpadding="5" cellspacing="2">
         <tr class="tableheader">
            <th align="left">Metric</th>
            <th align="right">Total</th>
            <th align="right">Density*</th>
         </tr>
         <tr class="tablerow0">
            <td>High Priority Warnings</td>
            <td align="right">2</td>
            <td align="right">1.36</td>
         </tr>
         <tr class="tablerow1">
            <td>Medium Priority Warnings</td>
            <td align="right">8</td>
            <td align="right">5.43</td>
         </tr>
         <tr class="$totalClass">
            <td>
               <b>Total Warnings</b>
            </td>
            <td align="right">
               <b>10</b>
            </td>
            <td align="right">
               <b>6.78</b>
            </td>
         </tr>
      </table>
      <p>
         <i>(* Defects per Thousand lines of non-commenting source statements)</i>
      </p>
      <p>
         <br/>
         <br/>
      </p>
      <h2>Summary</h2>
      <table width="500" cellpadding="5" cellspacing="2">
         <tr class="tableheader">
            <th align="left">Warning Type</th>
            <th align="right">Number</th>
         </tr>
         <tr class="tablerow0">
            <td>
               <a href="#Warnings_BAD_PRACTICE">Bad practice Warnings</a>
            </td>
            <td align="right">2</td>
         </tr>
         <tr class="tablerow1">
            <td>
               <a href="#Warnings_MALICIOUS_CODE">Malicious code vulnerability Warnings</a>
            </td>
            <td align="right">8</td>
         </tr>
         <tr class="tablerow0">
            <td>
               <b>Total</b>
            </td>
            <td align="right">
               <b>10</b>
            </td>
         </tr>
      </table>
      <p>
         <br/>
         <br/>
      </p>
      <h1>Warnings</h1>
      <p>Click on each warning link to see a full description of the issue, and
	    details of how to resolve it.</p>
      <h2>
         <a name="Warnings_BAD_PRACTICE">Bad practice Warnings</a>
      </h2>
      <table class="warningtable"
             width="100%"
             cellspacing="2"
             cellpadding="5">
         <tr class="tableheader">
            <th align="left">Warning</th>
            <th align="left">Priority</th>
            <th align="left">Details</th>
         </tr>
         <tr class="tablerow1">
            <td width="20%" valign="top">
               <a href="#DMI_RANDOM_USED_ONLY_ONCE">Random object created and used only once</a>
            </td>
            <td width="10%" valign="top">High</td>
            <td width="70%">
               <p>Random object created and used only once in nl.tudelft.jpacman.npc.Ghost.getInterval()<br/>
                  <br/>
                  <br/>In file Ghost.java Ghost.java,
					
						line 80 80<br/>In class nl.tudelft.jpacman.npc.Ghost<br/>In method nl.tudelft.jpacman.npc.Ghost.getInterval()<br/>Called method java.util.Random.nextInt(int)<br/>At Ghost.java:[line 80]<br/>At Ghost.java:[line 80]</p>
            </td>
         </tr>
         <tr class="tablerow0">
            <td width="20%" valign="top">
               <a href="#DMI_RANDOM_USED_ONLY_ONCE">Random object created and used only once</a>
            </td>
            <td width="10%" valign="top">High</td>
            <td width="70%">
               <p>Random object created and used only once in nl.tudelft.jpacman.npc.Ghost.randomMove()<br/>
                  <br/>
                  <br/>In file Ghost.java Ghost.java,
					
						line 100 100<br/>In class nl.tudelft.jpacman.npc.Ghost<br/>In method nl.tudelft.jpacman.npc.Ghost.randomMove()<br/>Called method java.util.Random.nextInt(int)<br/>At Ghost.java:[line 100]<br/>At Ghost.java:[line 100]</p>
            </td>
         </tr>
      </table>
      <p>
         <br/>
         <br/>
      </p>
      <h2>
         <a name="Warnings_MALICIOUS_CODE">Malicious code vulnerability Warnings</a>
      </h2>
      <table class="warningtable"
             width="100%"
             cellspacing="2"
             cellpadding="5">
         <tr class="tableheader">
            <th align="left">Warning</th>
            <th align="left">Priority</th>
            <th align="left">Details</th>
         </tr>
         <tr class="tablerow1">
            <td width="20%" valign="top">
               <a href="#EI_EXPOSE_REP">May expose internal representation by returning reference to mutable object</a>
            </td>
            <td width="10%" valign="top">Medium</td>
            <td width="70%">
               <p>nl.tudelft.jpacman.board.Unit.getSquare() may expose internal representation by returning Unit.square<br/>
                  <br/>
                  <br/>In file Unit.java Unit.java,
					
						line 54 54<br/>In class nl.tudelft.jpacman.board.Unit<br/>In method nl.tudelft.jpacman.board.Unit.getSquare()<br/>Field nl.tudelft.jpacman.board.Unit.square<br/>At Unit.java:[line 54]<br/>At Unit.java:[line 54]</p>
            </td>
         </tr>
         <tr class="tablerow0">
            <td width="20%" valign="top">
               <a href="#EI_EXPOSE_REP">May expose internal representation by returning reference to mutable object</a>
            </td>
            <td width="10%" valign="top">Medium</td>
            <td width="70%">
               <p>nl.tudelft.jpacman.game.SinglePlayerGame.getLevel() may expose internal representation by returning SinglePlayerGame.level<br/>
                  <br/>
                  <br/>In file SinglePlayerGame.java SinglePlayerGame.java,
					
						line 56 56<br/>In class nl.tudelft.jpacman.game.SinglePlayerGame<br/>In method nl.tudelft.jpacman.game.SinglePlayerGame.getLevel()<br/>Field nl.tudelft.jpacman.game.SinglePlayerGame.level<br/>At SinglePlayerGame.java:[line 56]<br/>At SinglePlayerGame.java:[line 56]</p>
            </td>
         </tr>
         <tr class="tablerow1">
            <td width="20%" valign="top">
               <a href="#EI_EXPOSE_REP">May expose internal representation by returning reference to mutable object</a>
            </td>
            <td width="10%" valign="top">Medium</td>
            <td width="70%">
               <p>nl.tudelft.jpacman.level.Player.getKiller() may expose internal representation by returning Player.killer<br/>
                  <br/>
                  <br/>In file Player.java Player.java,
					
						line 92 92<br/>In class nl.tudelft.jpacman.level.Player<br/>In method nl.tudelft.jpacman.level.Player.getKiller()<br/>Field nl.tudelft.jpacman.level.Player.killer<br/>At Player.java:[line 92]<br/>At Player.java:[line 92]</p>
            </td>
         </tr>
         <tr class="tablerow0">
            <td width="20%" valign="top">
               <a href="#EI_EXPOSE_REP">May expose internal representation by returning reference to mutable object</a>
            </td>
            <td width="10%" valign="top">Medium</td>
            <td width="70%">
               <p>nl.tudelft.jpacman.level.Player.getSprite() may expose internal representation by returning Player.deathSprite<br/>
                  <br/>
                  <br/>In file Player.java Player.java,
					
						line 118 118<br/>In class nl.tudelft.jpacman.level.Player<br/>In method nl.tudelft.jpacman.level.Player.getSprite()<br/>Field nl.tudelft.jpacman.level.Player.deathSprite<br/>At Player.java:[line 118]<br/>At Player.java:[line 118]</p>
            </td>
         </tr>
         <tr class="tablerow1">
            <td width="20%" valign="top">
               <a href="#EI_EXPOSE_REP2">May expose internal representation by incorporating reference to mutable object</a>
            </td>
            <td width="10%" valign="top">Medium</td>
            <td width="70%">
               <p>nl.tudelft.jpacman.board.Unit.occupy(Square) may expose internal representation by storing an externally mutable object into Unit.square<br/>
                  <br/>
                  <br/>In file Unit.java Unit.java,
					
						line 79 79<br/>In class nl.tudelft.jpacman.board.Unit<br/>In method nl.tudelft.jpacman.board.Unit.occupy(Square)<br/>Field nl.tudelft.jpacman.board.Unit.square<br/>Local variable named target<br/>At Unit.java:[line 79]<br/>At Unit.java:[line 79]</p>
            </td>
         </tr>
         <tr class="tablerow0">
            <td width="20%" valign="top">
               <a href="#EI_EXPOSE_REP2">May expose internal representation by incorporating reference to mutable object</a>
            </td>
            <td width="10%" valign="top">Medium</td>
            <td width="70%">
               <p>new nl.tudelft.jpacman.level.Level(Board, List, List, CollisionMap) may expose internal representation by storing an externally mutable object into Level.startSquares<br/>
                  <br/>
                  <br/>In file Level.java Level.java,
					
						line 105 105<br/>In class nl.tudelft.jpacman.level.Level<br/>In method new nl.tudelft.jpacman.level.Level(Board, List, List, CollisionMap)<br/>Field nl.tudelft.jpacman.level.Level.startSquares<br/>Local variable named startPositions<br/>At Level.java:[line 105]<br/>At Level.java:[line 105]</p>
            </td>
         </tr>
         <tr class="tablerow1">
            <td width="20%" valign="top">
               <a href="#EI_EXPOSE_REP2">May expose internal representation by incorporating reference to mutable object</a>
            </td>
            <td width="10%" valign="top">Medium</td>
            <td width="70%">
               <p>nl.tudelft.jpacman.level.Player.setKiller(Unit) may expose internal representation by storing an externally mutable object into Player.killer<br/>
                  <br/>
                  <br/>In file Player.java Player.java,
					
						line 101 101<br/>In class nl.tudelft.jpacman.level.Player<br/>In method nl.tudelft.jpacman.level.Player.setKiller(Unit)<br/>Field nl.tudelft.jpacman.level.Player.killer<br/>Local variable named killer<br/>At Player.java:[line 101]<br/>At Player.java:[line 101]</p>
            </td>
         </tr>
         <tr class="tablerow0">
            <td width="20%" valign="top">
               <a href="#EI_EXPOSE_REP2">May expose internal representation by incorporating reference to mutable object</a>
            </td>
            <td width="10%" valign="top">Medium</td>
            <td width="70%">
               <p>new nl.tudelft.jpacman.sprite.ImageSprite(Image) may expose internal representation by storing an externally mutable object into ImageSprite.image<br/>
                  <br/>
                  <br/>In file ImageSprite.java ImageSprite.java,
					
						line 29 29<br/>In class nl.tudelft.jpacman.sprite.ImageSprite<br/>In method new nl.tudelft.jpacman.sprite.ImageSprite(Image)<br/>Field nl.tudelft.jpacman.sprite.ImageSprite.image<br/>Local variable named img<br/>At ImageSprite.java:[line 29]<br/>At ImageSprite.java:[line 29]</p>
            </td>
         </tr>
      </table>
      <p>
         <br/>
         <br/>
      </p>
      <p>
         <br/>
         <br/>
      </p>
      <h1>
         <a name="Details">Warning Types</a>
      </h1>
      <h2>
         <a name="DMI_RANDOM_USED_ONLY_ONCE">Random object created and used only once</a>
      </h2>

<p> This code creates a java.util.Random object, uses it to generate one random number, and then discards
the Random object. This produces mediocre quality random numbers and is inefficient.
If possible, rewrite the code so that the Random object is created once and saved, and each time a new random number
is required invoke a method on the existing Random object to obtain it.
</p>

<p>If it is important that the generated Random numbers not be guessable, you <em>must</em> not create a new Random for each random
number; the values are too easily guessable. You should strongly consider using a java.security.SecureRandom instead
(and avoid allocating a new SecureRandom for each random number needed).
</p>

    <p>
         <br/>
         <br/>
      </p>
      <h2>
         <a name="EI_EXPOSE_REP">May expose internal representation by returning reference to mutable object</a>
      </h2>

  <p> Returning a reference to a mutable object value stored in one of the object's fields
  exposes the internal representation of the object.&nbsp;
   If instances
   are accessed by untrusted code, and unchecked changes to
   the mutable object would compromise security or other
   important properties, you will need to do something different.
  Returning a new copy of the object is better approach in many situations.</p>

    <p>
         <br/>
         <br/>
      </p>
      <h2>
         <a name="EI_EXPOSE_REP2">May expose internal representation by incorporating reference to mutable object</a>
      </h2>

  <p> This code stores a reference to an externally mutable object into the
  internal representation of the object.&nbsp;
   If instances
   are accessed by untrusted code, and unchecked changes to
   the mutable object would compromise security or other
   important properties, you will need to do something different.
  Storing a copy of the object is better approach in many situations.</p>

    <p>
         <br/>
         <br/>
      </p>
   </body>
</html>
